﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace XoLib.Generic
{
    /*
    public interface ICallBack
    {
        void GotCallBack();
        void TrigerCallBack();
    }

    public abstract class CallBack : ICallBack
    {
        protected static ushort Callbacktime = 100;
        private System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();

        public CallBack(ushort cbTime)
        {
            timer.Tick += new EventHandler(CallBackMethod);
            timer.Interval = cbTime;
        }


        public CallBack()
        {
            timer.Tick += new EventHandler(CallBackMethod);
            timer.Interval = Callbacktime;
        }


        ~CallBack()
        {
            if (timer != null && timer.Enabled)
            {
                GotCallBack();
            }
        }

        public void TrigerCallBack()
        {
            timer.Enabled = true;
        }

        private void CallBackMethod(object sender, EventArgs e)
        {
            timer.Enabled = false;
            GotCallBack();
          
        }

        public abstract void GotCallBack();

    }
     * */
}
